package main

import "fmt"

//#link: https://leetcode-cn.com/problems/corporate-flight-bookings/
func main() {
	bookings := [][]int{{1, 2, 10}, {2, 3, 20}, {2, 5, 25}}
	n := 5
	fmt.Println(corpFlightBookings(bookings, n))
}

func corpFlightBookings(bookings [][]int, n int) (ans []int) {
	ans = make([]int, n)
	for _, book := range bookings {
		for i := book[0] - 1; i <= book[1]-1; i++ {
			ans[i] += book[2]
		}
	}
	return ans
}
